// Student Name: jiawei lyu
// Date: 2.10.2024

#include "generate_output.h"
#include <iostream>

void printList(DoublyLinkedList& FIFOList) {
    std::ofstream& outFile = getOutFile();
    DllNode* current = FIFOList.head;
    while (current != nullptr) {
        std::cout << current->key << " ";
        outFile << current->key << " ";
        current = current->next;
    }
    std::cout << std::endl;
    outFile << std::endl;
}

void reversePrintList(DoublyLinkedList& FIFOList) {
    std::ofstream& outFile = getOutFile();
    DllNode* current = FIFOList.tail;
    while (current != nullptr) {
        std::cout << current->key << " ";
        outFile << current->key << " ";
        current = current->prev;
    }
    std::cout << std::endl;
    outFile << std::endl;
}
